function MyPlane() {
	if(!MyPlane.instance) {
		MyPlane.instance = {
			body: create("div"),
			imgArr:["me_die1","me_die2","me_die3","me_die4"],
			init: function() { //初始化我的飞机
				this.body.className = "my-warplain";
				new GameEngine().append(this);
				this.left(new GameEngine().width() / 2 - this.width() / 2);
				this.top(new GameEngine().height() - this.height());
				this.move();
				this.fire();
			},
			move: function() { //移动
				document.onmousemove = function(e) {
					var e = e || enent;
					var _left = e.clientX - new GameEngine().left() - new MyPlane().width() / 2;
					this.left(Math.min(new GameEngine().width() - new MyPlane().width(), Math.max(0, _left)))
				}.bind(this);
				this.explode();
			},
			left: function(val) {
				if(val || val == 0) {
					this.body.style.left = val + "px";
				}
				return this.body.offsetLeft;
			},
			top: function(val) {
				if(val || val == 0) {
					this.body.style.top = val + "px";
				}
				return this.body.offsetTop;
			},
			height: function() {
				return this.body.offsetHeight;
			},
			width: function() {
				return this.body.offsetWidth;
			},
			fire: function() { //开火
				this.fireTimer=setInterval(function() {
					new Bullet().init();
				}, new GameEngine().leval * 200)
			},
			explode: function() { //爆炸
				this.timer=setInterval(function(){
					for(var en of new GameEngine().enemes){
						var leftside=this.left()<en.left()+en.width();
						var rightside=this.left()+this.width()>en.left();
						var topside=this.top()<en.height()+en.top();
						var bottomside=this.top()+this.height()>en.top();
						if(leftside&&rightside&&topside&&bottomside){
							/*var bullets=document.getElementsByClassName("bullet");
							for(var i=0;i<bullets.length;i++){
								bullets[i].remove();
							}*/
							en.hurt();
							this.die();
							clearInterval(this.timer);
							clearInterval(this.fireTimer);
							new GameEngine().gameover();
							break;
						}
					}
				}.bind(this),30)
			},
			die:function(){
				var timer=setInterval(function(){
					if(this.imgArr.length==0){
						clearInterval(timer);
						this.body.remove();
					}
					this.body.style.background=`url(images/${this.imgArr.shift()}.png)`;
				}.bind(this),500)
			}
		}
	}
	return MyPlane.instance;
}